import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import {
  beforeEach
} from './routerEach'
import Login from "@/views/joinus/login";
import register from "@/views/joinus/index";

import forget from "@/views/joinus/forget";

const defaultRoutesr = [{
  //主页
  path: '/',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/layout'),
  name: 'app',
  redirect: 'index',
  children: [{
    path: 'index',
    component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/index'),
    name: 'index',
    meta: {
      index: 0,
    },
  },

  {
    path: '/task',
    component: () => import( '@/views/task'),
    name: 'task',
    meta: {
      index: 1,
    },
  },
  { //消息
    path: '/news',
    component: () => import( /* webpackChunkName: 'ImportFuncDemo' */  '@/views/news'),
    name: 'news',
    meta: {
      index: 2,
    },
  },
  {
    path: '/user',
    component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/user'),
    name: 'user',
    meta: {
      index: 3,
      title:'个人中心'
    },
  },
  ]
},
{
  //个人中心
  path: '/userinfo',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/userinfo'),
  name: 'userinfo',
  meta: {
    index: 2,
  },
},

{
  //公告列表
  path: '/notice',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/notice'),
  name: 'notice',
  meta: {
    index: 1,
  },
},

{
  //公告详情
  path: '/noticeinfo',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/notice/noticeinfo'),
  name: 'noticeinfo',
  meta: {
    index: 1,
  },
},
{
  //如何赚佣
  path: '/commission',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/commission'),
  name: 'commission',
  meta: {
    index: 2,
  },
},
{
  //如何赚佣
  path: '/member',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/member'),
  name: 'member',
  meta: {
    index: 2,
  },
},
{
  //推广二维码
  path: '/qrcode',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/qrcode'),
  name: 'qrcode',
  meta: {
    index: 2,
  },
},
{
  //发布任务
  path: '/publish',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/publish'),
  name: 'publish',
  meta: {
    index: 2,
  },
},
{
  //任务列表
  path: '/pubtasklist',
  component: () => import( '@/views/task/pubtasklist'),
  name: 'pubtasklist',
  meta: {
    index: 2,
  },
},

{
  //任务列表
  path: '/tasklobby',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/task/tasklobby'),
  name: 'tasklobby',
  meta: {
    index: 3,
  },
},

{
  //已接任务列表
  path: '/submittask',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/task/submittask'),
  name: 'submittask',
  meta: {
    index: 3,
  },
},
{
  //上传任务
  path: '/submit',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/task/submit'),
  name: 'submit',
  meta: {
    index: 3,
  },
},
{
  //任务详情
  path: '/taskinfo',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/task/taskinfo'),
  name: 'taskinfo',
  meta: {
    index: 3,
  },
},
{
  //是否接任务
  path: '/taskAcceptCheck',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/task/taskAcceptCheck'),
  name: 'taskAcceptCheck',
  meta: {
    index: 3,
  },
},
//------------------我的团队
{
  // 我的团队
  path: '/teamlist',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/myteam/teamlist'),
  name: 'teamlist',
  meta: {
    index: 3,
  },
},
{
  // 团队成员
  path: '/invite',
  component: () => import( '@/views/myteam/invite'),
  name: 'invite',
  meta: {
    index: 3,
  },
},

{
  // 会员
  path: '/vip',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/myteam/vip'),
  name: 'vip',
  meta: {
    index: 4,
  },
},
{
  // 会员详细信息
  path: '/vipinfo',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/myteam/vipinfo'),
  name: 'vipinfo',
  meta: {
    index: 5,
  },
},
//-------------银行卡
{
  // 银行卡列表
  path: '/cardList',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/user/cardList'),
  name: 'cardList',
  meta: {
    index: 6,
  },
},
{
  // 银行卡新增
  path: '/cardAdd',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/user/cardAdd'),
  name: 'cardAdd',
  meta: {
    index: 6,
  },
},
{
  // 银行卡修改删除
  path: '/cardDetail',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/user/cardDetail'),
  name: 'cardDetail',
  meta: {
    index: 6,
  },
},

{
  // 佣金记录
  path: '/wallet',
  component: () => import( '@/views/user/wallet'),
  name: 'wallet',
  meta: {
    index: 7,
  },
},
{
  // 充值提现转账
  path: '/financial',
  component: () => import( '@/views/financial/index'),
  name: 'financial',
  meta: {
    index: 8,
  },
},
{

  // 提现
  path: '/cash',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/financial/cash'),
  name: 'cash',
  meta: {
    index: 9,
  },
},

{

  // 提现明细
  path: '/withdrawDatail',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/financial/withdrawDatail'),
  name: 'withdrawDatail',
  meta: {
    index: 9,
  },
},

{
  // 提现方式修改
  path: '/cashMode',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/financial/cashMode'),
  name: 'cashMode',
  meta: {
    index: 10,
  },
},

{
  // 提现方式修改
  path: '/cashAdd',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/financial/cashAdd'),
  name: 'cashAdd',
  meta: {
    index: 11,
  },
},
{
  // 查看提现内容
  path: '/cashInfo',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/financial/cashInfo'),
  name: 'cashInfo',
  meta: {
    index: 11,
  },
},

{
  // 获取充值账号
  path: '/rechargeAccount',
  component: () => import( '@/views/financial/rechargeAccount'),
  name: 'rechargeAccount',
  meta: {
    index: 8,
  },
},
  //----------------服务
{
  path: '/customerService',
  component: () => import('@/views/server/customer'),
  name: 'customerService',
  meta: {
    index: 999,
  },
},
{
  path: '/feedback',
  component: () => import('@/views/server/feedback'),
  name: 'feedback',
  meta: {
    index: 999,
  },
},
{
  path: '/feedbackAdd',
  component: () => import('@/views/server/feedbackAdd'),
  name: 'feedbackAdd',
  meta: {
    index: 999,
  },
},
//-----------------------加入我们
{
  path: '/login',
  component: Login,
  name: 'login',
  meta: {
    index: 999,
  },
},
{
  path: '/register',
  component: register,
  name: 'register',
  meta: {
    index: 1000,
  },
},
{
  path: '/forget',
  component: forget,
  name: 'forget',
  meta: {
    index: 1001,
  },
},
//-----------------------消息
{
  path: '/newsList',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/news/newsList'),
  name: 'newsList',
  meta: {
    index: 999,
  },
},



//----------------------other
{
  path: '/401',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/error-page/401')
},
{
  path: '/404',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/error-page/404')
},
{
  path: '*',
  component: () => import( /* webpackChunkName: 'ImportFuncDemo' */ '@/views/error-page/404')
}
]
const router = new VueRouter({
  mode:'history',
  routes: defaultRoutesr // (缩写) 相当于 routes: routes
})
router.beforeEach(beforeEach);

export default router
